package com.vf.admin.miaodong.controller.fiwork;

import com.vf.admin.common.BaseController;
import com.vf.admin.common.splitpage.SplitPageBean;
import com.vf.admin.miaodong.entity.AppTaskRecord;
import com.vf.admin.miaodong.service.AfterTaskRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/manage/app/taskrecord")
public class AppTaskRecordManageController extends BaseController {


    @Autowired
    private AfterTaskRecordService taskRecordService;

    @RequestMapping("/page")
    public String page(SplitPageBean splitPage, String userId, String nick, String startDate, String endDate) {
        try {
            Map<String, Object> params = new HashMap<>();
            params.put("userId", userId);
            params.put("nick", nick);
            params.put("startDate", startDate);
            params.put("endDate", endDate);
            List<AppTaskRecord> list = taskRecordService.findList(params, splitPage);
            request.setAttribute("list", list);
            request.setAttribute("splitPage", splitPage);
            return this.sucess("/web/manage/app/taskrecord/list");
        } catch (Exception e) {
            e.printStackTrace();
            return this.error("系统繁忙");
        }
    }

}
